#!/bin/bash

function gselectfile_mode() {

    [[ $type = directory ]] && {
        echo --directory;
    }
    [[ $type = save ]] && {
        echo --save;
    }

}

zenity --file-selection $(gselectfile_mode) ${filter+--file-filter="$filter"} \
${overwrite+--confirm-overwrite} ${multiple+--multiple} \
${delimiter+--seperator="$delimiter"} ${file+--filename="$file"} \
--title="${1:=${title:-gselectfile}}";

